package com.guoxin.thread.stop;

import java.sql.SQLOutput;

public class MyThread extends Thread {

    @Override
    public void run() {
        try {
            for (int i = 0; i < 10000; i++) {
                if(this.isInterrupted()){
                    throw new InterruptedException();
                }
                System.out.println("run =" + i);
            }
            System.out.println("线程仍然在执行");
        } catch (InterruptedException e) {
            System.out.println("进入了catch");
        }
    }
}

